<?php

class Core_Action_Admin_Setting_Mail_Template_Index extends Action_Admin
{

	public function execute($request, $initial = FALSE, $scritp = NULL)
	{
		if ($initial)
		{
			Agilet::setVar('breadcrum', array(
				array(
					'url' => 'admin/setting',
					'label' => 'Settings'
				),
				array(
					'url' => 'admin/setting/mail',
					'label' => 'Mail'
				),
				array(
					'url' => 'admin/setting/mail/template',
					'label' => 'Template'
				)
			));

		}

		$table = Model::getTable('core/mailtemplate');
		
		$select = $table -> select();
		$items = $table -> fetchAll($select);
		
		$request -> response = View::render($script = 'core/html/admin/setting/mail/template/index', $data = array('items' => $items));
	}

}
